{extend name="iframe" /}
{block name="body"}
<style>
    .layui-form-label{width: 90px !important;}
</style>
<form action="{:request()->url()}" class="layui-form mt30 mr50" method="post">
    <div class="layui-form-item">
        <label class="layui-form-label">选择章</label>
        <div class="layui-input-block">
            {if condition="$zhang"}
            <select name="chapterid" lay-verify="required">
                {else/}
                <select name="chapterid">
                    {/if}
                    <option value="">选择章</option>
                    {foreach name="$zhang" item="v"}
                    <option value="{$v.id}"  {notempty name="$data"}{if condition="$data['chapterid'] eq $v.id" }selected="selected"{/if}{/notempty}>{$v.title}</option>
                    {/foreach}
                </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">课时标题</label>
        <div class="layui-input-block">
            <input type="text" name="title"  value="{$data.title|default=''}" autocomplete="off" placeholder="请输入章名称" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">是否免费</label>
        <div class="layui-input-block">
            <input type="radio" name="isfree" {eq name="$data.isfree|default=1" value="1"}checked{/eq} title="是" value="1"  />
            <input type="radio" name="isfree" {eq name="$data.isfree|default=0" value="0"}checked{/eq} title="否" value="0" />
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">开跑马灯</label>
        <div class="layui-input-block">
            <input type="radio" name="isbulletscreen" {eq name="$data.isbulletscreen|default=1" value="1"}checked{/eq} title="是" value="1"  />
            <input type="radio" name="isbulletscreen" {eq name="$data.isbulletscreen|default=0" value="0"}checked{/eq} title="否" value="0" />
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">云视频ID</label>
        <div class="layui-input-block">
            <input type="text"  name="videoid" value="{$data.videoid|default=''}" autocomplete="off" placeholder="请选择云视频" class="layui-input">
            <button href="{:url('admin/course/videolist')}" type="button" class="layui-btn layui-btn-primary layui-btn-position ajax-iframe" data-width="800px" data-height="490px"><i class="fa fa-cloud"></i> 选择云视频</button>
            <input type="hidden"  name="playtimes" value="{$data.playtimes|default=''}" autocomplete="off" placeholder="请选择云视频" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">试看时间</label>
        <div class="layui-input-block">
            <input type="text" name="previewtimes" value="{$data.previewtimes|default=''}" autocomplete="off" placeholder="单位秒，0表示不支持试看" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-block">
            <input type="text" name="sort_order" value="{$data.sort_order|default=0}" autocomplete="off" placeholder="章排序,默认即可" class="layui-input">
            <input type="hidden" name="csid" value="{$cid}"  class="layui-input">
            <input type="hidden" name="ischapter" value="0"  class="layui-input">
            <input type="hidden" name="status" value="1"  class="layui-input">
            <input type="hidden" name="sectype" value="1"  class="layui-input">
            <input type="hidden" name="coursetype" value="1"  class="layui-input">
            <input type="hidden" name="addtime" value="{$addtime}"  class="layui-input">
        </div>
    </div>
    <div class="layui-form-item mt30">
        <div class="layui-input-block">
            <button class="layui-btn" lay-filter="i" lay-submit="">保存</button>
            <button class="layui-btn layui-btn-primary" type="reset">重置</button>
        </div>
    </div>
</form>
{/block}